package com.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface UserMapper  extends BaseMapper<User> {

    User findByUserName(String userName);

    // 禁用用户
    @Update("UPDATE user SET is_disable = 1 WHERE id = #{userId}")
    int disableUserById(@Param("userId") Integer userId);

    //解禁用户
    @Update("UPDATE user SET is_disable = 0 WHERE id = #{userId}")
    int enableUserById(@Param("userId") Integer userId);


}
